import { aps } from '@/common/request';
import { formatter } from '@/common/request/formatter';

const { postRequest } = aps;

export default class Service {
  async search(payload: any): Promise<any> {
    const data = await postRequest('scheduler/getRoomResourceGroupScheduler', payload);
    return formatter(data);
  }

  async getTaskInfo(payload: any): Promise<any> {
    const data = await postRequest('assignment/getTaskInfo', payload);
    return formatter(data);
  }

  async assignmentTask(payload: any): Promise<boolean> {
    const data = await postRequest('assignment/assignmentTask', payload);
    return formatter(data);
  }

  async getAssignmentTask(payload: any): Promise<any[]> {
    const data = await postRequest('batchOrder/getAssignmentBatchOrderList', payload);
    return formatter(data);
  }

  async getTaskList(payload: any): Promise<any[]> {
    const data = await postRequest('assignment/getAssignmentMesTaskList', payload);
    return formatter(data);
  }
}
